<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>食物详情</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
    <div class="container mt-5">
        <div class="card">
            <div class="card-header">
                <h3 class="card-title">食物详情</h3>
            </div>
            <div class="card-body">
                <div class="row">
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label class="form-label">ID</label>
                            <p class="form-control-plaintext" th:text="${food.id}"></p>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">名称</label>
                            <p class="form-control-plaintext" th:text="${food.name}"></p>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">类别</label>
                            <p class="form-control-plaintext" th:text="${food.category}"></p>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">卡路里(千卡/100g)</label>
                            <p class="form-control-plaintext" th:text="${food.calories}"></p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label class="form-label">蛋白质(g/100g)</label>
                            <p class="form-control-plaintext" th:text="${food.protein}"></p>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">脂肪(g/100g)</label>
                            <p class="form-control-plaintext" th:text="${food.fat}"></p>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">碳水化合物(g/100g)</label>
                            <p class="form-control-plaintext" th:text="${food.carbohydrates}"></p>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">描述</label>
                            <p class="form-control-plaintext" th:text="${food.description}"></p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="card-footer">
                <a th:href="@{/foods/list}" class="btn btn-secondary">返回列表</a>
                <a th:href="@{/foods/edit/{id}(id=${food.id})}" class="btn btn-warning float-end">编辑</a>
            </div>
        </div>
    </div>
</body>
</html>    